package com.bjc2;

import java.util.ArrayList;
import java.util.Random;

/**
 * @program: jvm_demo
 * @description:  -Xms600m -Xmx600m -XX:SurvivorRatio=8
 * @author: bjc
 * @create: 2022-03-10 22:09
 */
public class HeapInstanceTest {

    byte[] buffer = new byte[new Random().nextInt(1024*100)];

    public static void main(String[] args) {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        ArrayList<HeapInstanceTest> list = new ArrayList<>();
        while (true){
            list.add(new HeapInstanceTest());
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
